<template>
  <div class="hello">
    <el-button type="danger" @click="queryCourseGradeSmall">获取数据</el-button>
    <div v-for="(item,index) in data" :key="index">
      {{item.sName}}| {{item.sBirth}} | {{item.sSex}}
    </div>
  </div>

</template>

<script>
import axios from 'axios';
import {ApiUrls} from '@/api/api'


export default {
  name: 'HelloWorld',
  props: {
    msg: String
  },
  data() {
    return {
      data: [],
    }
  },
  methods: {
    queryCourseGradeSmall() {
      axios.get("http://192.168.230.1:9002/medical/a")
          .then(response => {
            console.log('Response from Java backend:', response.data);
            this.data = response.data.data
            // 处理从后端接收到的数据
            console.log("data: ",this.data)
          })
          .catch(error => {
            console.error('Error fetching data from Java backend:', error);
            // 处理错误
          });
    }
  },
}

</script>


<style scoped>

</style>

